<html>
<head><meta charset="utf-8"><title>Jointness in TokenStream · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Jointness.20in.20TokenStream.html">Jointness in TokenStream</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="176543650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Jointness%20in%20TokenStream/near/176543650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Jointness.20in.20TokenStream.html#176543650">(Sep 25 2019 at 08:27)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> while working on jointness-preserving mbe, I've noticed that proc macro tt stores jointness as a field of <code>Token</code>, while <code>libsyntax::TokenStream</code> stores jointness as <code>TreeAndJoin</code>. Do you think it might make sense to move jointness to the <code>Token</code> in libsyntax as well? That certainly would make it harder to lose jointness along the way, and should be easier to work with, as matching <code>(tree, is_joint)</code> tuple is awkward.</p>



<a name="176550220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Jointness%20in%20TokenStream/near/176550220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Jointness.20in.20TokenStream.html#176550220">(Sep 25 2019 at 10:03)</a>:</h4>
<blockquote>
<p>Do you think it might make sense to move jointness to the Token in libsyntax as well?</p>
</blockquote>
<p>Yes, I think that makes sense.</p>



<a name="176550412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Jointness%20in%20TokenStream/near/176550412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Jointness.20in.20TokenStream.html#176550412">(Sep 25 2019 at 10:06)</a>:</h4>
<p>I thought about it when implementing <a href="https://github.com/rust-lang/rust/issues/61541" target="_blank" title="https://github.com/rust-lang/rust/issues/61541">#61541</a>, and wanted to do it myself later, but it didn't happen.</p>



<a name="176550469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Jointness%20in%20TokenStream/near/176550469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Jointness.20in.20TokenStream.html#176550469">(Sep 25 2019 at 10:07)</a>:</h4>
<p>IIRC, it doesn't even increase the size of <code>Token</code>, but I'm not sure.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>